package com.cyy.factory_pattern.abstract_factory.person;

import com.cyy.factory_pattern.abstract_factory.S1;
import com.cyy.factory_pattern.abstract_factory.S2;
import com.cyy.factory_pattern.abstract_factory.Zz;
import com.cyy.factory_pattern.abstract_factory.pigeon.*;
import com.cyy.factory_pattern.abstract_factory.sword.*;

/**
 * 男铸剑师类
 */
public class Nan implements Zz {
    private static S1 s1;
    private static S2 s2;

    @Override
    public S1 abc1(String a) {
        if ("长虹剑".equals(a)) {
            s1 = new A1();
        } else if ("奔雷剑".equals(a)) {
            s1 = new F1();
        } else if ("青光剑".equals(a)) {
            s1 = new E1();
        } else if ("雨花剑".equals(a)) {
            s1 = new D1();
        } else if ("旋风剑".equals(a)) {
            s1 = new G1();
        } else {
            System.out.println("铸剑失败");
        }
        return s1;

    }

    @Override
    public S2 abc2(String a) {
        if ("灵鸽一号".equals(a)) {
            s2 = new A2();
        } else if ("灵鸽六号".equals(a)) {
            s2 = new F2();
        } else if ("灵鸽五号".equals(a)) {
            s2 = new E2();
        } else if ("灵鸽四号".equals(a)) {
            s2 = new D2();
        } else if ("灵鸽七号".equals(a)) {
            s2 = new G2();
        } else {
            System.out.println("领养失败");
        }
        return s2;
    }
}
